package com.cmii.sjw.department.control.jsc.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.cmii.sjw.department.control.jsc.mapper.UniversitiesEducationMapper;
import com.cmii.sjw.department.control.jsc.model.UniversitiesEducation;
import com.cmii.sjw.department.control.jsc.model.params.UniversitiesParams;
import com.cmii.sjw.department.control.jsc.model.vo.KxzyjsVo;
import com.cmii.sjw.department.control.jsc.model.vo.UniversitiesEducationVo;
import com.cmii.sjw.department.control.jsc.service.UniversitiesEducationService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author jfh
 * @Date 2025年06月06日 10:27
 */
@Slf4j
@Service
public class UniversitiesEducationServiceImpl implements UniversitiesEducationService {

    @Autowired
    private UniversitiesEducationMapper universitiesEducationMapper;

    @Override
    public KxzyjsVo kxzyjs(UniversitiesParams params) {

        log.info("参数:{}",params);
        KxzyjsVo kxzyjsVo = new KxzyjsVo();
        /** “双一流”学科 */
        List<UniversitiesEducation> sylxk = universitiesEducationMapper.selectList(new QueryWrapper<>(
                new UniversitiesEducation()
                        .setUniversitiesName(params.getUniversitiesName())
                        .setMetricName("“双一流”学科")
        ));
        /** 市级重点学科 */
        List<UniversitiesEducation> sjzdkxk = universitiesEducationMapper.selectList(new QueryWrapper<>(
                new UniversitiesEducation()
                        .setUniversitiesName(params.getUniversitiesName())
                        .setMetricName("市级重点学科")
        ));
        kxzyjsVo.setSylxk(sylxk);
        kxzyjsVo.setSjzdkxk(sjzdkxk);
        return kxzyjsVo;
    }

    @Override
    public List<UniversitiesEducation> bxgm(UniversitiesParams params) {
        log.info("参数:{}",params);
        List<UniversitiesEducation> bxgmList = universitiesEducationMapper.selectList(new QueryWrapper<>(
                new UniversitiesEducation()
                        .setUniversitiesName(params.getUniversitiesName())
                        .setSectionName("在校生情况")
        ));
        return bxgmList;
    }
}
